﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage.Master"
    CodeBehind="wfPlanillaMnt.aspx.cs" Inherits="RH.wfPlanillaMnt" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Import Namespace="Texfina.Common.Mg" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../Styles/jquery-ui.custom.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        window.onload = function () {

            var menuTable = document.getElementById('<%=mnuToolbar.ClientID %>');
            var menuLinks = menuTable.getElementsByTagName("a");
            if (menuLinks != null) {
                switch (menuLinks.length) {
                    case 2:
                        menuLinks[0].onclick = function () { return validateEditForm('_BTTSAVE') }
                        break;

                    case 3:
                        menuLinks[0].onclick = function () { return validateEditForm('_BTTSAVE') }
                        menuLinks[1].onclick = function () { return validateEditForm('_BTTSAVNEW') }
                        break;
                }
            }

            this.ResizeGrid();
            this.MessageOnPostback();
        }

        function ResizeGrid() {
            internalGridResize("<%= grdList.ClientID %>");
        }

        function panelOnUpdating() {
            updatePanelAnimationUpdating();
        }

        function panelOnUpdated() {
            ResizeGrid();
            updatePanelAnimationUpdated();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="ToolBar">
        <asp:Menu ID="mnuToolbar" runat="server" CssClass="ToolBarControl" Orientation="Horizontal"
            OnMenuItemClick="mnuToolbar_MenuItemClick">
            <Items>
                <asp:MenuItem Text="Guardar" Value="_BTTSAVE" ImageUrl="../Images/Icons/Enabled/SAVE.png">
                </asp:MenuItem>
                <asp:MenuItem Text="Salir" Value="_BTTEXIT" ImageUrl="../Images/Icons/Enabled/BACK.png">
                </asp:MenuItem>
            </Items>
        </asp:Menu>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="DataHeader">
                <table id="TableDataHeader" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="3">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                        <td>
                            Datos Planilla
                        </td>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                        <td>
                            <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px;
                                -webkit-border-radius: 5px; -ms-border-radius: 5px;">
                                <table width="100%" cellpadding="0" cellspacing="2">
                                    <tr>
                                        <td colspan="13">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 5px">
                                            &nbsp;
                                        </td>
                                        <td style="width: 110px;">
                                            Codigo
                                        </td>
                                        <td colspan="10">
                                            <esd:esdMaskedTextBox runat="server" ID="txtidPlanilla" Width="100px" Mask="999">
                                            </esd:esdMaskedTextBox>
                                        </td>
                                        <td style="width: 5px">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 5px">
                                            &nbsp;
                                        </td>
                                        <td>
                                            Planilla
                                        </td>
                                        <td colspan="2">
                                            <esd:esdTextBox runat="server" ID="txtdsPlanilla" Width="180px"></esd:esdTextBox>
                                        </td>
                                        <td style="width: 30px;">
                                            &nbsp;
                                        </td>
                                        <td style="width: 110px;">
                                            Nro. de Proceso Anual
                                        </td>
                                        <td colspan="2">
                                            &nbsp;
                                        </td>
                                        <td style="width: 30px;">
                                            &nbsp;
                                            <esd:esdTextBox runat="server" ID="txtnuProcAnual" Width="180px"></esd:esdTextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td colspan="2">
                                            &nbsp;
                                        </td>
                                        <td style="width: 5px">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="13">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </div>
            <div class="DataDetail">
                <table width="100%" cellpadding="0" cellspacing="2">
                    <tr>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                        <td>
                            <div class="ToolBarGrid">
                                <asp:Menu ID="mnuGrid" runat="server" Orientation="Horizontal" CssClass="ToolBarControl"
                                    OnMenuItemClick="mnuGrid_MenuItemClick">
                                    <Items>
                                        <asp:MenuItem Text="Nuevo" Value="_BTTNEW" ImageUrl="../Images/Icons/Enabled/New.png">
                                        </asp:MenuItem>
                                    </Items>
                                </asp:Menu>
                            </div>
                            <esd:esdGridView CssClass="esdGridView" ID="grdList" runat="server" ScrollWidth="100%"
                                Width="100%" ShowHeaderWhenEmpty="True" AutoGenerateColumns="False" DataKeyNames="idConRemu"
                                OnRowCommand="grdList_RowCommand" OnRowDataBound="grdList_RowDataBound">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="grdBttCmdEdit" CommandName="CmdEdit" CommandArgument="<%# Container.DataItemIndex %>"
                                                runat="server" ImageUrl="../Images/Icons/Enabled/Edit.png" ToolTip="Editar Concepto Remunerativo" />
                                            </ItemTemplate>
                                            <headerstyle width="22px" />
                                            <itemstyle horizontalalign="Center" verticalalign="Middle" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <itemtemplate>
                                 <asp:ImageButton ID="grdBttCmdDelete" CommandName="CmdDel" CommandArgument="<%# Container.DataItemIndex %>"
                                    runat="server" ImageUrl="../Images/Icons/Enabled/Delete.png" ToolTip="Eliminar Concepto Remunerativo" />
                              </itemtemplate>
                                                <headerstyle width="22px" />
                                                <itemstyle horizontalalign="Center" verticalalign="Middle" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Deshabilitado">
                                                <itemtemplate>
                            <asp:CheckBox ID="chkstDesHabilita" runat="server" ToolTip="Deshabilitar Concepto Remunerativo" />
                            </itemtemplate>
                                                <headerstyle width="22px" />
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="idConRemu" HeaderText="codigo"></asp:BoundField>
                                            <asp:BoundField DataField="dsConRemu" HeaderText="Descripcion"></asp:BoundField>
                                            <asp:BoundField DataField="nuSecuen" HeaderText="Nro. Secuencia"></asp:BoundField>
                                            <asp:BoundField DataField="stInhabilita" HeaderStyle-CssClass="hideDataGridColumn" ItemStyle-CssClass="hideDataGridColumn">
                                             </asp:BoundField>
                                            <asp:BoundField DataField="stAnulado" HeaderStyle-CssClass="hideDataGridColumn" ItemStyle-CssClass="hideDataGridColumn">

                                            </asp:BoundField>
                                            </Columns>
                                            <emptydatatemplate>
                                    <div id="gridempty">
                                        <asp:Image ID="imgEmpty" runat="server" ImageUrl="../Images/Controls/Attention.png" />
                                        &nbsp;No existen registros para esta solicitud.
                                    </div>
                                </emptydatatemplate>
                                            </esd:esdGridView> </td>
                                            <td style="width: 5px">
                                                &nbsp;
                                            </td>
                                            </tr> </table> </div>
                                            <asp:HiddenField ID="hdnMsgOPB" runat="server" />
                                            <asp:HiddenField ID="hdnidConRemu" runat="server" />
                                            <asp:HiddenField ID="hdnModalPopup" runat="server" />
                                            <asp:Panel runat="server" ID="PnlPopup" CssClass="modalPopup" Style="display: none;"
                                                Width="500px">
                                                <table width="100%" cellpadding="0" cellspacing="2">
                                                    <tr>
                                                        <td colspan="3">
                                                            <div class="modalPopupHeader">
                                                                &nbsp;&nbsp;&nbsp;<asp:Label ID="lblTitlePopup" runat="server"></asp:Label>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="3">
                                                            &nbsp;
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="width: 5px;">
                                                            &nbsp;
                                                        </td>
                                                        <td>
                                                            <table width="100%" cellpadding="1" cellspacing="2">
                                                                <tr>
                                                                    <td colspan="13">
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="width: 5px">
                                                                        &nbsp;
                                                                    </td>
                                                                    <td>
                                                                        Concepto Remuneración:
                                                                    </td>
                                                                    <td colspan="10">
                                                                        <esd:esdButtonTextBox runat="server" ID="txtidConRemu" Width="250px">   
                                                                        </esd:esdButtonTextBox>
                                                                    </td>
                                                                    <td style="width: 5px">
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="width: 5px">
                                                                        &nbsp;
                                                                    </td>
                                                                    <td>
                                                                        Nº Secuencia:
                                                                    </td>
                                                                    <td colspan="10">
                                                                        <esd:esdNumericTextBox ID="txtnuSecuen" runat="server" Width="40px" NumericType="Integer">
                                                                        </esd:esdNumericTextBox>
                                                                    </td>
                                                                    <td style="width: 5px">
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="width: 5px">
                                                                        &nbsp;
                                                                    </td>
                                                                    <td>
                                                                        Deshabilitado:
                                                                    </td>
                                                                    <td colspan="10">
                                                                        <asp:CheckBox ID="chkstHabilitado" runat="server" Checked="false" />
                                                                    </td>
                                                                    <td style="width: 5px">
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="13">
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                        <td style="width: 5px;">
                                                            &nbsp;
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="3">
                                                            &nbsp;
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="width: 5px;">
                                                            &nbsp;
                                                        </td>
                                                        <td align="right">
                                                            <esd:esdButton ID="bttOkPopup" runat="server" Text="Aceptar" Width="80px" OnClick="bttOkPopup_Click">
                                                            </esd:esdButton>
                                                            <esd:esdButton ID="bttCancelPopup" runat="server" Text="Cancelar" Width="80px"></esd:esdButton>
                                                        </td>
                                                        <td style="width: 5px;">
                                                            &nbsp;
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="3">
                                                            &nbsp;
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                            <ajax:ModalPopupExtender runat="server" ID="mdlPopup" PopupControlID="PnlPopup" BackgroundCssClass="modalBackground"
                                                TargetControlID="hdnModalPopup">
                                            </ajax:ModalPopupExtender>
                                            </ContentTemplate> </asp:UpdatePanel>
                                            <ajax:UpdatePanelAnimationExtender ID="upae" BehaviorID="animation" runat="server"
                                                TargetControlID="updatePanel1">
                                                <animations>
        <OnUpdating>
        <Parallel duration="0.5">
            <ScriptAction Script="panelOnUpdating();" />  
        </Parallel>
        </OnUpdating>
        <OnUpdated>
        <Parallel duration="0.5">
            <ScriptAction Script="panelOnUpdated();" /> 
        </Parallel> 
        </OnUpdated>
    </animations>
                                            </ajax:UpdatePanelAnimationExtender>
                                            <div id="Div1" class="updateProgress" style="display: none">
                                                <table width="100%">
                                                    <tr>
                                                        <td valign="middle">
                                                            <img src="../Images/Controls/Loading.gif" />
                                                        </td>
                                                        <td valign="middle">
                                                            <span class="updateProgressMessage">Cargando ...</span>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
</asp:Content> 